<?php

use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', [\App\Http\Controllers\IndexController::class, 'index'])->name('home');

//用户
Route::resource("user", \App\Http\Controllers\UserController::class);

//登录
Route::post('login', [\App\Http\Controllers\LoginController::class, 'login'])->name('login');
Route::get('loginshow', [\App\Http\Controllers\LoginController::class, 'show'])->name('loginshow');
//退出
Route::get('login', [\App\Http\Controllers\LoginController::class, 'logout'])->name('login');

//邮箱认证
Route::get('emailToken', [\App\Http\Controllers\UserController::class, 'emailToken'])->name('emailtoken');

//找回密码
Route::get('findpassword', [\App\Http\Controllers\PasswordContoller::class, 'index'])->name('findpassword');
Route::post('findpasswordemail', [\App\Http\Controllers\PasswordContoller::class, 'sendemail'])->name('findpasswordemail');
Route::get('findpasswordstore/{token}', [\App\Http\Controllers\PasswordContoller::class, 'findpasswordstore'])->name('findpasswordstore');

Route::post('setpassword', [\App\Http\Controllers\PasswordContoller::class, 'setpassword'])->name('setpassword');


//博客

Route::resource('blog', \App\Http\Controllers\BlogController::class);

//关注与取消
Route::get('follow/{user}', [\App\Http\Controllers\UserController::class, 'follow'])->name('user.follow');

//粉丝与关注列表
Route::get('followinglist/{user}', [\App\Http\Controllers\FollowController::class, 'following'])->name('following');
Route::get('followed/{user}', [\App\Http\Controllers\FollowController::class, 'followed'])->name('followed');

